import {useState,useEffect} from 'react'
import axios from 'axios'

function Advance(props){
    const [number,setNumber]=useState(()=>{
        return props.number
    })
    useEffect(()=>{
        async function fetchData(){
            const res=await axios.get('https://www.fastmock.site/mock/39ac87de3060aa2bb2ba20a0ff375c81/cat-movie/mostLike')
            console.log(res);
        }
        fetchData()
        return ()=>{
            
        }

        
    })
    return(
        <div>
            <button onClick={()=>setNumber(number+2)}>current number:{number}</button>
        </div>
    )
}

export default Advance